package com.qfedu.service.impl;

import com.qfedu.dao.SysCityMapper;
import com.qfedu.pojo.SysCity;
import com.qfedu.service.SysCityService;
import com.qfedu.vo.VCity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class SysCityServiceImpl implements SysCityService {

    @Autowired
    private SysCityMapper sysCityDao;

//     取车地址和还车地址
    @Override
    public List<SysCity> selectAll(Integer pid) {
        List<SysCity> list = sysCityDao.selectByPid(pid);
        return list;
    }

//    骑车地址和还车地址的显示
    @Override
    public VCity selectCitys(Integer getid, Integer backid) {
        SysCity getCity = sysCityDao.selectByPrimaryKey(getid);
        SysCity backCity = sysCityDao.selectByPrimaryKey(backid);
        VCity vCity = new VCity();
        vCity.setBackCity(backCity);
        vCity.setGetCity(getCity);
        return vCity;
    }
}
